   	<script type="text/javascript" src="../com.atilax.frmwk/jquery-1.11.3.js"></script>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<p><p>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<!--  loading -->
<link rel="stylesheet" href="dist/ladda-themeless.min.css">
<script src="dist/spin.min.js"></script>
<script src="dist/ladda.min.js"></script>   



<div class="panel   panel-default" style="width:95%;margin-left:10px">
  <div class="panel-heading">-----上传升级------------------</div>
  <div class="panel-body">
    
	
			  



<!-- body start -->


<div style="display:none">
路径与配置
<textarea rows="3" cols="200" id="cfgtextbox" style="width:100%">
 
 

 
</textarea>
</div>
  
	上传升级包：<input type = "file" name = "filex" onchange="upload()" id="filex"  style="display:inline" class="btn btn-default"/>      &nbsp;  &nbsp;  &nbsp;<img id="loadimg" src="..\com.attilax\loading\loading-0.gif">
升级包安装起始路径：<input type = "text" name = "shellExePath" id="shellExePath"  style="width:500px;display:inline"/> 
<span id="upaftinfo" >	
服务器保存路径：<input type = "text" name = "savepath" id="savepath"  style="width:500px;display:inline"/>  
 shell读取编码：<input id="encodetxt" list="encode_list" class="s_ipt" value="utf8" maxlength="2550" autocomplete="on" style="width:100px" >
 <datalist id="url_list">
	<option label="logcfgfile" value="C:\0wkspc\hislog\src\main\resources\log4j.properties" />
	<option label="logfile" value="C:\0log\hislog.log" />
	<option label="Microsoft" value="http://www.microsoft.com" />
</datalist>
 <datalist id="encode_list">
	<option label="utf8" value="utf8" />
	<option label="gbk" value="gbk" />
	 
</datalist> 
</span>
 <button   type="button" class="btn btn-success" onclick="btn_click()" >
 提交执行更新  
  </button>
  <img id="loadimg_exe" src="..\com.attilax\loading\loading_bar.gif" style="display:none"> 



<script>
  $("#upaftinfo").hide();
var testdats={"dbginfo":["upzip file准备解压文件:update.bat","upzip file to dst解压文件到当前目录:c:\\d\\dd2/update.bat","upzip file准备解压文件:war/","upzip file to dst解压文件到当前目录:c:\\d\\dd2/war/"]};
var dbg=testdats.dbginfo;
   //下面使用each进行遍历
           $.each(dbg, function (n, value) {
                console.log(value);
           });
		   console.log( dbg.join("\r\n"));


  $("#loadimg").hide();
function upload()
{
 
  $("#savepath").val("上传中");
  $("#loadimg").show();
	var self=this;
 
	var fd = new FormData();
	fd.append("serverSavePath", "/tmp");
	fd.append("upfile", $("#filex").get(0).files[0]);
	$.ajax({
		url: "../UploadServlet1",
		type: "POST",
		processData: false,
		contentType: false,
		data: fd,
		success: function(d) {
			console.log(d);
			console.log("----fini");
		    $("#savepath").val(d);
			  $("#loadimg").hide();
			  $("#upaftinfo").show();
		}
	});	
 

}

 


function btn_click()
{
$("#loadimg_exe").show();
$("#editctrl").val("");	
//alert("");
url="../autoupSrv?cmdtextbox=@savepath@&mode=&cwd="+$("#cwd").val()+"&cfgtextbox=@cfgtextbox@&cmdFrom=file&encode=@encode@&shellExePath=@shellExePath@";
url=url.replace("@savepath@",encodeURIComponent($("#savepath").val()));
url=url.replace("@cfgtextbox@", encodeURIComponent($("#cfgtextbox").val()));
url=url.replace("@encode@",$("#encodetxt").val());
url=url.replace("@shellExePath@", encodeURIComponent($("#shellExePath").val()));

$.get(url, function(result,status,xhr){
	     if(result['@type'])
		 {
		   //  @type":"com.attilax.util.RuntimeExceptionAtiVer   
			$("#editctrl").val(    JSON.stringify(result) );
			$("#loadimg_exe").hide();		 
			return;
		 }
	          
	 		//   console.log( result.join("\r\n"));
		$("#editctrl").val(result.join("\r\n"));		 
				$("#loadimg_exe").hide();		 
	 },"json");
    
}
	
	
	</script>


<textarea rows="50" cols="200" id="editctrl" style="width:100%">
 
运行结果。。。。

 
</textarea>
<!-- end -->


  </div>
</div>